from base.mybase import Tools


class login_model(Tools):
    # 定义路径
    path = '/user/login'

    # 发送登录请求
    def login_action(self, usr, pwd, check='1234'):
        login_data = {
            "username": usr,
            "password": self.make_md5(pwd),
            "checkcode": check
        }
        login = self.huihua.post(url=self.hosturl+self.path, data=login_data)
        return login.json()

# import requests
# s = requests.session()
# login = login_model(huihua=s)
# msg = login.login_action(usr='rrer123', pwd='rr1234', check='1234')
# print(msg)
